Methods and devices for data compression using offset-based adaptive reconstruction levels

ABSTRACT

Encoding and decoding methods are presented that used offset-based adaptive reconstruction levels. The offset data is inserted in the bitstream with the encoded video data. The offset data may be differential data and may be an index to an array of offset values from which the differential offset is calculated by the decoder. The offset to an adaptive reconstruction level may be adjusted for each slice. The offsets may be specific to a particular level/index and data type. In some cases, offsets may only be sent for a subset of the levels. Higher levels may apply no offset, may apply an average offset, or may apply the offset used for the highest level having a level-specific offset.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to U.S. provisional Ser. No.61/446,528 filed Feb. 25, 2011, the contents of which are herebyincorporated by reference.

FIELD

The present application generally relates to data compression and, inparticular, to methods and devices for using adaptive reconstructionlevels in quantization and de-quantization.

BACKGROUND

Data compression occurs in a number of contexts. It is very commonlyused in communications and computer networking to store, transmit, andreproduce information efficiently. It finds particular application inthe encoding of images, audio and video. Video presents a significantchallenge to data compression because of the large amount of datarequired for each video frame and the speed with which encoding anddecoding often needs to occur. The current state-of-the-art for videoencoding is the ITU-T H.264/AVC video coding standard. It defines anumber of different profiles for different applications, including theMain profile, Baseline profile and others. A next-generation videoencoding standard is currently under development through a jointinitiative of MPEG-ITU: High Efficiency Video Coding (HEVC).

There are a number of standards for encoding/decoding images and videos,including H.264, that use block-based coding processes. In theseprocesses, the image or frame is divided into blocks, typically 4×4 or8×8, and the blocks are spectrally transformed into coefficients,quantized, and entropy encoded. In many cases, the data beingtransformed is not the actual pixel data, but is residual data followinga prediction operation. Predictions can be intra-frame, i.e.block-to-block within the frame/image, or inter-frame, i.e. betweenframes (also called motion prediction). It is expected that HEVC willalso have these features.

When spectrally transforming residual data, many of these standardsprescribe the use of a discrete cosine transform (DCT) or some variantthereon. The resulting DCT coefficients are then quantized using aquantizer that employs a uniform quantization step size, i.e. a uniformpartitioning of the data space.

Work in lossy compression, e.g., audio/voice coding, video coding, imagecoding, etc., tends to focus on improving rate-distortion performance.That is, the objective of most encoding and decoding schemes is to findan optimal balance between distortion and coding rate. A rate-distortionoptimization expression of the type J=D+λR is typically used, whereinthe Lagrangian multiplier λ, represents the desired trade-off betweencoding rate and distortion.

It would be advantageous to provide for an improved encoder, decoder andmethod of encoding or decoding.

BRIEF DESCRIPTION OF THE DRAWINGS

Reference will now be made, by way of example, to the accompanyingdrawings which show example embodiments of the present application, andin which:

FIG. 1 shows, in block diagram form, an encoder for encoding video;

FIG. 2 shows, in block diagram form, a decoder for decoding video;

FIG. 3 shows an example of a partitioned data space;

FIG. 4 shows an example of data point distribution within a sub-part ofthe partitioned data space;

FIG. 5 shows, in flowchart form, an example method for encoding datapoints using quantization with adaptive reconstruction levels;

FIG. 6 shows, in flowchart form, an example method for encoding videodata using soft-decision quantization with adaptive reconstructionlevels;

FIG. 7 shows, in flowchart form, an example method of decoding videodata that has been encoded using quantization with adaptivereconstruction levels;

FIG. 8 shows a flow diagram for an example method of encoding indicesusing offsets for adaptive reconstruction levels;

FIG. 9 diagrammatically shows an example bitstream format;

FIG. 10 shows a flow diagram for an example method of decoding encodedcompressed data using offset-based adaptive reconstruction levels;

FIG. 11 shows a simplified block diagram of an example embodiment of anencoder;

FIG. 12 shows a simplified block diagram of an example embodiment of adecoder; and

FIG. 13 shows, in flowchart form, an example decoding process usingoffset-based adaptive reconstruction levels.

Similar reference numerals may have been used in different figures todenote similar components.

DESCRIPTION OF EXAMPLE EMBODIMENTS

The present application describes methods and encoders/decoders forachieving rate-distortion improvements in lossy data compression. Insome embodiments, the data compression process or devices describedherein may be applied to the encoding and decoding of audio data, imagedata, and/or video data. In particular, the present applicationdescribes a method and process of data compression that uses adaptivereconstruction levels within a quantization operation.

In one aspect, the present application describes an adaptive scheme ofcomputing and transmitting the reconstruction levels for scalarquantizers to achieve a better rate distortion coding performancewithout materially increasing the coding complexity. From the ratedistortion coding performance point of view, the example processesherein achieve significant distortion reduction while requiring a verysmall number of bits. From the coding complexity point of view, the atleast one example method is simple and fast because it involves solvinga quadratic optimization problem on the encoder side. On the decoderside, the at least one example method with adaptive reconstructionlevels does not increase the computational complexity, and involves onlysome extra memory consumption.

In another aspect, the present application describes a method ofdecoding a bitstream of encoded compressed data. The method includesentropy decoding the encoded compressed data to obtain indices and toobtain offset data associated with at least one of the indices;determining an associated reconstruction level for each index, whereinthe associated reconstruction level for said at least one of the indicesis determined by adjusting a predetermined reconstruction level usingthe offset data; and reconstructing a data point for each obtained indexusing that index's associated reconstruction level.

In yet another aspect, the present application describes a method forencoding transform domain coefficients for a group of coding units,wherein the transform domain coefficients are quantized by a quantizerthat associates each transform domain coefficient with an index basedupon in which sub-part of a partitioned data space that transform domaincoefficient is found. The method includes determining the averagetransform domain coefficient for each sub-part; calculating an offsetfor each sub-part by determining a difference between the averagetransform domain coefficient for that sub-part and a predeterminedreconstruction level for that sub-part; and entropy encoding the indicesassociated with the transform domain coefficients, and entropy encodingat least one of the offsets, to output a bitstream of encoded data.

In another aspect, the present application provides a method of decodinga bitstream of compressed data. The method includes extracting offsetdata from the bitstream, wherein the offset data is associated with anindex; calculating a reconstruction level for the index by adjusting apredetermined reconstruction level using the offset data; decoding thecompressed data to obtain a plurality of quantized transformcoefficients; and dequantizing each quantized transform coefficient thatcorresponds to the index to generate a data point using the index'scalculated reconstruction level.

In yet a further aspect, the present application describes a method forencoding transform domain coefficients for a group of coding units,wherein the transform domain coefficients are quantized by a quantizerthat associates each transform domain coefficient with an index basedupon in which sub-part of a partitioned data space that transform domaincoefficient is located. The method includes determining the averagetransform domain coefficient at least one of the sub-parts; calculatingan offset for that sub-part by determining a difference between theaverage transform domain coefficient for that sub-part and apredetermined reconstruction level for that sub-part; and entropyencoding the indices associated with the transform domain coefficientsto output a bitstream of encoded data and inserting into the bitstreamoffset data from which the offset for that sub-part can be calculated.

In a further aspect, the present application describes encoders anddecoders configured to implement such methods of encoding and decoding.

In yet a further aspect, the present application describescomputer-readable media storing computer-executable program instructionswhich, when executed, configured a processor to perform the describedmethods of encoding and/or decoding.

In yet an additional aspect, the present application describes aprocessor-readable medium storing a bitstream of encoded compresseddata, wherein the compressed data, when decoded, is structured toinclude a plurality of consecutive portions, and wherein each portionincludes video data containing indices representing quantized transformdomain coefficients obtained through a video encoding process for agroup of coding units, and offset data for adjusting one or morepredetermined reconstruction levels used in dequantizing the quantizedtransform domain coefficients.

Other aspects and features of the present application will be understoodby those of ordinary skill in the art from a review of the followingdescription of examples in conjunction with the accompanying figures.

In the description that follows, some example embodiments are describedwith reference to the H.264 standard for video coding. Those ordinarilyskilled in the art will understand that the present application is notlimited to H.264 but may be applicable to other video coding/decodingstandards, including possible future standards, such as HEVC, multiviewcoding standards, scalable video coding standards, and reconfigurablevideo coding standards. It will also be appreciated that the presentapplication is not necessarily limited to video coding/decoding and maybe applicable to audio coding/decoding, image coding/decoding, or thelossy coding/decoding of any other data. The present application isbroadly applicable to any lossy data compression process that employsquantization irrespective of the type of data being coded/decoded.

In the description that follows, when referring to video or images theterms frame, slice, tile and rectangular slice group may be usedsomewhat interchangeably. Those of skill in the art will appreciatethat, in the case of the H.264 standard, a frame may contain one or moreslices. It will also be appreciated that certain encoding/decodingoperations are performed on a frame-by-frame basis, some are performedon a slice-by-slice basis, some tile-by-tile, and some by rectangularslice group, depending on the particular requirements of the applicableimage or video coding standard. In any particular embodiment, theapplicable image or video coding standard may determine whether theoperations described below are performed in connection with framesand/or slices and/or tiles and/or rectangular slice groups, as the casemay be. Accordingly, those ordinarily skilled in the art willunderstand, in light of the present disclosure, whether particularoperations or processes described herein and particular references toframes, slices, tiles, rectangular slice groups are applicable toframes, slices, tiles, rectangualar slice groups, or some or all ofthose for a given embodiment. This also applies to coding units, groupsof coding units, etc., as will become apparent in light of thedescription below.

In the discussion that follows, reference is made to DCT coefficientsand the DCT domain; however, it will be appreciated that thisapplication is not limited the encoding of DCT coefficients, theencoding of block-based transform coefficients, the encoding ofblock-based data, or any particular data type.

To the extent that the processes or methods described below are appliedto images and/or video they may be applied to a portion of a video orimage, such as a frame, a slice, a Group-of-Pictures (GOP), or on anyother basis, such as to a coding unit, or group of coding units. To theextent that the process or methods described herein are applied toaudio, such as music or voice data, they may be applied to a grouping orsequence of data points, e.g. an audio sample.

Reference is now made to FIG. 1, which shows, in block diagram form, anencoder 10 for encoding video. Reference is also made to FIG. 2, whichshows a block diagram of a decoder 50 for decoding video. It will beappreciated that the encoder 10 and decoder 50 described herein may eachbe implemented on an application-specific or general purpose computingdevice, containing one or more processing elements and memory. Theoperations performed by the encoder 10 or decoder 50, as the case maybe, may be implemented by way of application-specific integratedcircuit, for example, or by way of stored program instructionsexecutable by a general purpose processor. The device may includeadditional software, including, for example, an operating system forcontrolling basic device functions. The range of devices and platformswithin which the encoder 10 or decoder 50 may be implemented will beappreciated by those ordinarily skilled in the art having regard to thefollowing description.

The encoder 10 receives a video source 12 and produces an encodedbitstream 14. The decoder 50 receives the encoded bitstream 14 andoutputs a decoded video frame 16. The encoder 10 and decoder 50 may beconfigured to operate in conformance with a number of video compressionstandards. For example, the encoder 10 and decoder 50 may be H.264/AVCcompliant. In other embodiments, the encoder 10 and decoder 50 mayconform to other video compression standards, including evolutions ofthe H.264/AVC standard, like HEVC.

The encoder 10 includes a spatial predictor 21, a coding mode selector20, transform processor 22, quantizer 24, and entropy encoder 26. Aswill be appreciated by those ordinarily skilled in the art, the codingmode selector 20 determines the appropriate coding mode for the videosource, for example whether the subject frame/slice is of I, P, or Btype, and whether particular coding units (e.g. macroblocks) within theframe/slice are inter or intra coded. The transform processor 22performs a transform upon the spatial domain data. In particular, thetransform processor 22 applies a block-based transform to convertspatial domain data to spectral components. For example, in manyembodiments a discrete cosine transform (DCT) is used. Other transforms,such as a discrete sine transform or others may be used in someinstances. The block-based transform is performed on a macroblock orsub-block basis, depending on the size of the macroblocks. In the H.264standard, for example, a typical 16×16 macroblock contains sixteen 4×4transform blocks and the DCT process is performed on the 4×4 blocks. Insome cases, the transform blocks may be 8×8, meaning there are fourtransform blocks per macroblock. In yet other cases, the transformblocks may be other sizes. In some cases, a 16×16 macroblock may includea non-overlapping combination of 4×4 and 8×8 transform blocks.

Applying the block-based transform to a block of pixel data results in aset of transform domain coefficients. A “set” in this context is anordered set in which the coefficients have coefficient positions. Insome instances the set of transform domain coefficients may beconsidered a “block” or matrix of coefficients. In the descriptionherein the phrases a “set of transform domain coefficients” or a “blockof transform domain coefficients” are used interchangeably and are meantto indicate an ordered set of transform domain coefficients.

The set of transform domain coefficients is quantized by the quantizer24. The quantized coefficients and associated information are thenencoded by the entropy encoder 26.

Intra-coded frames/slices (i.e. type I) are encoded without reference toother frames/slices. In other words, they do not employ temporalprediction. However intra-coded frames do rely upon spatial predictionwithin the frame/slice, as illustrated in FIG. 1 by the spatialpredictor 21. That is, when encoding a particular block the data in theblock may be compared to the data of nearby pixels within blocks alreadyencoded for that frame/slice. Using a prediction algorithm, the sourcedata of the block may be converted to residual data. The transformprocessor 22 then encodes the residual data. H.264, for example,prescribes nine spatial prediction modes for 4×4 transform blocks. Insome embodiments, each of the nine modes may be used to independentlyprocess a block, and then rate-distortion optimization is used to selectthe best mode.

The H.264 standard also prescribes the use of motionprediction/compensation to take advantage of temporal prediction.Accordingly, the encoder 10 has a feedback loop that includes ade-quantizer 28, inverse transform processor 30, and deblockingprocessor 32. These elements mirror the decoding process implemented bythe decoder 50 to reproduce the frame/slice. A frame store 34 is used tostore the reproduced frames. In this manner, the motion prediction isbased on what will be the reconstructed frames at the decoder 50 and noton the original frames, which may differ from the reconstructed framesdue to the lossy compression involved in encoding/decoding. A motionpredictor 36 uses the frames/slices stored in the frame store 34 assource frames/slices for comparison to a current frame for the purposeof identifying similar blocks. Accordingly, for macroblocks to whichmotion prediction is applied, the “source data” which the transformprocessor 22 encodes is the residual data that comes out of the motionprediction process. For example, it may include information regardingthe reference frame, a spatial displacement or “motion vector”, andresidual pixel data that represents the differences (if any) between thereference block and the current block. Information regarding thereference frame and/or motion vector may not be processed by thetransform processor 22 and/or quantizer 24, but instead may be suppliedto the entropy encoder 26 for encoding as part of the bitstream alongwith the quantized coefficients.

Those ordinarily skilled in the art will appreciate the details andpossible variations for implementing H.264 encoders.

The decoder 50 includes an entropy decoder 52, dequantizer 54, inversetransform processor 56, spatial compensator 57, and deblocking processor60. A frame buffer 58 supplies reconstructed frames for use by a motioncompensator 62 in applying motion compensation. The spatial compensator57 represents the operation of recovering the video data for aparticular intra-coded block from a previously decoded block.

The bitstream 14 is received and decoded by the entropy decoder 52 torecover the quantized coefficients. Side information may also berecovered during the entropy decoding process, some of which may besupplied to the motion compensation loop for use in motion compensation,if applicable. For example, the entropy decoder 52 may recover motionvectors and/or reference frame information for inter-coded macroblocks.

The quantized coefficients are then dequantized by the dequantizer 54 toproduce the transform domain coefficients, which are then subjected toan inverse transform by the inverse transform processor 56 to recreatethe “video data”. It will be appreciated that, in some cases, such aswith an intra-coded macroblock, the recreated “video data” is theresidual data for use in spatial compensation relative to a previouslydecoded block within the frame. The spatial compensator 57 generates thevideo data from the residual data and pixel data from a previouslydecoded block. In other cases, such as inter-coded macroblocks, therecreated “video data” from the inverse transform processor 56 is theresidual data for use in motion compensation relative to a referenceblock from a different frame. Both spatial and motion compensation maybe referred to herein as “prediction operations”.

The motion compensator 62 locates a reference block within the framebuffer 58 specified for a particular inter-coded macroblock. It does sobased on the reference frame information and motion vector specified forthe inter-coded macroblock. It then supplies the reference block pixeldata for combination with the residual data to arrive at thereconstructed video data for that macroblock.

A deblocking process may then be applied to a reconstructed frame/slice,as indicated by the deblocking processor 60. After deblocking, theframe/slice is output as the decoded video frame 16, for example fordisplay on a display device. It will be understood that the videoplayback machine, such as a computer, set-top box, DVD or Blu-Rayplayer, and/or mobile handheld device, may buffer decoded frames in amemory prior to display on an output device.

It is expected that HEVC-compliant encoders and decoders will have manyof these same or similar features.

Quantization

For a given block of pixels x with a prediction p, the residual isz=x−p. In this example, the block of pixels x and residual z are thesame size as the transform matrix t. The residual z is transformed (forexample by using a DCT) to generate the set of transform domaincoefficients c. The coefficients c are quantized using a selectedquantization step size q to produce a set of quantized coefficients u.This may be expressed as:u=round(c/q+f)  (1)

where an input c is quantized to a by applying the quantization stepsize q, and 1>f>0 is a rounding offset. Because the quantization outputis calculated by a deterministic function, this is also calledhard-decision quantization.

The quantization operation can be viewed from a rate-distortionpoint-of-view. In fact, the quantization operation can be refined so asto select indices u such that the selected indices result in a minimumrate-distortion cost. The minimum rate-distortion cost may be expressedas follows:

$\begin{matrix}{{\min\limits_{u}{{c - {u \cdot q}}}^{2}} + {\lambda \cdot {r(u)}}} & (2)\end{matrix}$

In Equation (2), c is the matrix of transform coefficients, q is thequantization step size, and u is the corresponding matrix of indices towhich the coefficients have been quantized. The symbol · stands forelement-wise multiplication between matrixes. λ is the Lagrangianmultiplier, a constant that is determined by end users based on theirpreference of the coding rate and the video quality. A relatively smallλ puts more preference on better quality, while a larger λ emphasizes ona lower coding rate. r(u) represents the rate function by entropy codingfor the indices u, and r(u) represents the rate function for encodingand transmitting u. The entropy coding may be any suitable or applicableentropy coding scheme. In the case of JPEG images, for example, thecoding may be Huffman coding. In the case of H.264 video, the coding maybe CAVLC or CABAC coding. Yet other context-dependent orcontext-independent coding schemes may be applicable in particularembodiments. Clearly, the quantization output from Equation (2) is notgiven by a deterministic function anymore, but is the output of anoptimization process that relates to both the rate and the distortion.Thus, it is named soft-decision quantization.

Example embodiments of soft-decision quantization are described in USpatent publication no. 2007/0217506 filed by Yang et al. (hereinafter“Yang”). The Yang publication describes the optimization of u given afixed q. This is termed “soft-decision quantization”, since thetransform domain coefficients themselves are treated as free-parametersin the rate-distortion optimization. The application of soft-decisionquantization to H.264 encoding using CAVLC is described in Yang, and itmay include the use of a trellis to search for a set of quantizedcoefficients u that result in a minimum cumulative rate-distortion for agiven entropy encoding scheme. In the example described in Yang, theH.264 CAVLC encoding scheme was used for illustration.

In H.264 and in many other coding schemes the quantization step sizesare predetermined, and in a particular instance the encoder selects oneof the quantization step sizes to use for quantizing a particular set ofdata points, whether a block, slice, frame, etc. The encoder then onlyneeds to transmit an index or indicator so as to inform the decoderwhich quantization step size was used.

Reference is now made to FIG. 3, which graphically illustrates a portionof a data space 100. In this example, the data space 100 contains theset of data points to be quantized using a selected quantization scheme.Conceptually, in order to perform quantization, the data space 100 maybe considered to be partitioned into sub-parts A₀, A₁, . . . A_(N),where N+1 is the number of sub-parts. Each sub-part may be referenced byits index u, where u=0, 1, . . . , N. A data point falling within one ofthe sub-parts A_(i) is quantized to index u=i. Reconstruction levelsq_(u) are at the midpoint of their respective sub-parts. When thedecoder reconstructs a data point, it reconstructs it as reconstructionlevel q_(u); in the case of u=i the data point is reconstructed as q_(i)irrespective of where within the sub-part A_(i) the actual data pointwas located. With a quantization step size of q, each reconstructionlevel q_(i) is given by i·q. If the source data is uniform, then theassumption of a midpoint reconstruction level will result in minimaldistortion; however the assumption of a uniform distribution of sourcedata may be inaccurate in many cases.

Reference is now made to FIG. 4, which shows an example sub-part A_(i).The midpoint reconstruction level is shown as q_(i). The non-uniformdistribution of the source data points is shown as reference numeral102. It will be appreciated that data points with a distribution asshown by 102 would be better represented by an adaptive reconstructionlevel at or near q_(i)′. The adaptive reconstruction level may be basedupon the actual distribution of data points that are associated with orassigned the index i, i.e. that are located within the sub-part A_(i).The adaptive reconstruction level may be based upon the arithmetic meanor median or mode, in some embodiments. By adjusting the reconstructionlevel to reflect the distribution of the actual data points within asub-part A_(i), the presently described process compensates for some ofthe distortion attributable to the non-uniform distribution of the datapoints when relying upon an assumption of uniformity.

In many data compression processes, when quantization is performed thepartitioning of the data space and selection of the reconstructionlevels are not considered separately. For example, in ITU-T H.264/AVC,both are subsumed under the selection of a quantization step size. Thepresent applicants have recognized that the partitioning of the dataspace and the selection of a reconstruction level for each sub-part maybe considered separately, and need not be based upon a pre-determinedreconstruction level, for example at the midpoint of the sub-part as inITU-T H.264/AVC.

Thus, the quantization under this process becomes a two-stage operation.First, the data points are assigned to a quantization index (i.e. basedon the partitioning of the data space, the data points are grouped intosub-parts). The partitioning/quantization at this first stage may beuniform, non-uniform, predetermined hard-decision quantization, orsoft-decision quantization. The step size/partition size may be selectedfrom amongst a preset number of candidate step sizes/partition sizesbased on a rate-distortion optimization process. In all these possiblevariations, the data points are each assigned one of the indices for theselected quantization partition structure.

Second, the adaptive reconstruction level for each sub-part of thepartitioned data space (e.g. each index) is determined. The adaptivereconstruction level may be based upon an averaging of actual datapoints falling within the sub-part. The averaging may occur over a blockor coding unit, group of blocks or coding units, slice, frame,group-of-pictures (GOP) or other suitable collection of data pointsgiven the specific application. It may also occur over a group of codingunits or frames having a common quantization parameter qP. In some casesthe same frame or GOP may have coding units with different qP, in whichcase those coding units having the same qP may be considered a group ofcoding units for the purpose of determining adaptive reconstructionlevels for that group of coding units.

The selection of the adaptive reconstruction level for each index may bebased upon a rate-distortion analysis. In other words, it may be basedupon selecting a reconstruction level that minimizes the totaldistortion given the actual data points within the sub-part. It mayfurther be based upon minimizing a cost function including distortionfrom the difference between the reconstruction level and the actual datapoints and the rate cost associated with transmitting the reconstructionlevel. The rate cost associated with transmitting the reconstructionlevel may be based upon the encoding scheme used to entropy encode thereconstruction levels.

Reference is now made to FIG. 5, which shows, in flowchart form, amethod 200 of quantizing data. The method 200 is for quantizing andencoding a plurality data points. The data points fall within a dataspace that may be considered to be partitioned into a set of sub-partsfor the purpose of the quantization. Each of the sub-parts has anassociated quantization index.

In operation 202, a quantization index is assigned to each of the datapoints. In other words, each data point falling within a sub-part isassigned the quantization index of that sub-part. The quantization thatoccurs in operation 202 may be hard-decision quantization orsoft-decision quantization. The partitioning of the data space may beuniform or non-uniform.

Once the data points have been quantized in operation 202, i.e. haveeach been assigned a quantization index, then in operation 204 anadaptive reconstruction level is calculated for each quantization index.The adaptive reconstruction level of a given index is calculated basedon minimizing the joint cost of the total distortion from quantizing thedata points within that sub-part and the rate of transmitting theadaptive reconstruction level. A Lagrangian rate-distortion costexpression may be used to determine the minimum cost and select thecorresponding adaptive reconstruction level.

Once the adaptive reconstruction level for each index has beencalculated in operation 204, then in operation 206 the adaptivereconstruction levels and the quantized data points are entropy encoded.It will be understood that the data points themselves are not encoded,but rather the quantization indices that have been assigned to them bythe quantization of operation 202. Any suitable entropy encoding processor scheme may be used to encode the reconstruction levels. Selection ofa suitable entropy encoding method, including selection of no encoding,is within the skill of an ordinary person familiar with the art.

In one example embodiment, given the quantization indices u^(n) for agroup of blocks c^(n), the adaptive reconstruction levels are calculatedto minimize a joint cost of the total distortion and the extra rate fortransmitting the reconstruction levels. For each quantization index u,let c_(u,1), c_(u,2), . . . , c_(u,m) denote the input source symbols(for example, DCT coefficients in H.264 before quantization) which arequantized to u, where m is an integer depending upon u. Then we findq_(u) such that q_(u) minimizes(c _(u,1) −u·q _(u))²+(c _(u,m) −u·q _(u))²+ . . . +(c _(u,m) −u·q_(u))² +λ·r(q _(u))  (3)

where r(q_(u)) denotes the length function of a prefix code for q_(u)according to the selected entropy encoding scheme.

Reference is now made to FIG. 6, which shows, in flowchart form, anexample method 300 of encoding video data. This example method 300illustrates the specific application of the quantization processdescribed above in the context of video encoding. The method 300 may beimplemented in a video encoder using hardware, software, or acombination thereof.

In operation 302 blocks of transform domain coefficients c are obtained.It will be appreciated that there are many preceding steps, includingperforming motion or spatial prediction and obtaining residual values,with or without rate-distortion optimization. The transform domaincoefficients c are obtained through spectral transform of the residualdata, in some instances using a DCT operation. In many instances, thetransform is performed on a block-by-block basis. The H.264 standard,for example, prescribes a DCT operation performed on 4×4 or 8×8 blocksof residual data. The resulting set of transform domain coefficients cinclude 16 or 64 data points, as the case may be. It will be appreciatedthat some of the operations described herein may also be performed on ablock-by-block basis. However, in many cases the method 300 ofdetermining adaptive reconstruction levels may be performed for groupsof blocks at a time, such as a slice, frame, GOP, or other grouping ofblocks of data.

In operation 304, given a set of reconstruction levels q_(u) for apartitioning with indices u, soft decision quantization is performed toquantize the transform domain coefficients c, i.e. to assign an index ufor each transform domain coefficient c. The soft decision quantizationmay include selecting indices a that minimize a total rate-distortioncost. Equation (2) above is an example expression that may be used tofind indices resulting in a minimum total rate-distortion cost. Theinitial set of reconstruction levels q_(u) may be those reconstructionlevels associated with the current quantization step size, as prescribedby the applicable encoding standard. In at least one example, theinitial set of reconstruction levels is simply the preselectedquantization step size q.

Out of operation 304, the transform domain coefficients c are eachquantized and represented by an assigned index u. In operation 306,those assigned indices u are fixed and adaptive reconstruction levelsq_(u) are found that minimize a rate-distortion cost, such as that givenby Equation (3) above. After operation 306, each index a has an updatedreconstruction level (referred to herein as an adaptive reconstructionlevel) q_(u).

The process may be iterative. That is, operations 304 and 306 may berepeated by fixing the reconstruction levels in operation 304 to findindices that minimize the cost expression of Equation (2) and thenfixing the indices in operation 306 to find the reconstruction levelsthat minimize the cost expression of Equation (3), repeatedly. Operation308 may include an evaluation of whether to stop the iterative loop ofoperations 304 and 306. In this example operation 308 determines whetherthe adaptive reconstruction levels q_(u) have changed by more than athreshold amount γ. If so, then operations 304 and 306 are repeated. Ifnot, then the method 300 moves to operation 310, where the video isentropy encoded. This operation 310 includes entropy encoding theindices u and the adaptive reconstruction levels q_(u).

Decoding of an encoded video is now illustrated by way of the examplemethod 400 shown in FIG. 7. The example method 400 is preceded byobtaining or receiving the encoded video data, for example over acomputer network, a broadcast network, a cellular network, a short-rangenetwork, or from a digital recording device such as a DVD or othercomputer-readable medium. In operation 402 the bitstream of encodedvideo data is entropy decoded to obtain the indices u and the adaptivereconstruction levels q_(u). In operation 404, the transform domaincoefficients are reconstructed as u·q_(u). The reconstructed transformdomain coefficients are then inverse transformed in operation 406, andsuitable spatial or motion compensation is applied, as the case may be,in operation 408. In operation 410 the video is output, for example to adisplay screen or through a video output port.

It will be appreciated that in some embodiments, an adaptivereconstruction level q_(u) may not be encoded and transmitted for everysub-part. Some sub-parts may have too few data points to justify sendingan adaptive reconstruction level q_(u) from a rate-distortion point ofview. In other cases, some sub-parts may have a data point distributionwith a median that does not deviate significantly from the midpoint ofthe sub-part, meaning that the adaptive reconstruction level q_(u) isnearly identical to the midpoint and the distortion gain does notoutweigh the rate cost associated with sending the adaptivereconstruction level q_(u).

In some embodiments, the rate distortion cost of transmitting a givenreconstruction level may be evaluated. Specifically, a parameter, calledthe rate value, may be calculated and the adaptive reconstruction levelis transmitted if the rate value is greater than the number of bits thatis needed to transmit this reconstruction level. In one exampleembodiment, the rate value may be expressed as:

$\begin{matrix}{N_{i} \cdot {( {{\frac{1}{N_{i}}{\sum\limits_{n = 1}^{N_{i}}c_{n}^{(i)}}} - {i \cdot q}} )^{2}/\lambda}} & (4)\end{matrix}$

where N_(i) is the number of data points in the sub-part A_(i).

In one embodiment, the encoder and decoder may be configured such thatthe encoder calculates and transmits adaptive reconstruction levelsq_(u) for lower indices. As soon as the encoder encounters an index inwhich the adaptive reconstruction level q_(u) should not be sent, due toa rate-distortion analysis, then the encoder ceases to calculateadaptive reconstruction levels for higher indices and inserts a stopcode in the encoding of the adaptive reconstruction levels q_(u) toindicate to the decoder that no further levels will be sent for higherindices. Other methods or operations for determining which adaptivereconstruction levels to send may be used.

In a case study of residual coding for video compression, a simplescheme of signaling adaptive reconstruction levels for only a fewselected sub-parts as the corresponding average of data points withinthose sub-parts has proved to improve the rate distortion performancesignificantly.

In one possible embodiment, a finite set of quantizers with variousreconstruction levels may be constructed or preconfigured. In theencoding process, the encoder may dynamically select one quantizer fromthe set of quantizers on the basis that it realizes the bestrate-distortion performance, i.e. lowest cost, among the candidatequantizers of the set. The choice of quantizer is then communicated tothe decoder in the output bitstream.

In yet a further embodiment, rather than sending reconstruction levelsq_(u), the encoder may send an offset value δ for each reconstructionlevel. That is, the adaptive reconstruction level for indices u=i isgiven by i·q+δ_(i). The offset δ_(i) for sub-part A_(i) may becalculated as q _(i)−i·q, where q _(i) is the calculated adaptivereconstruction level for that sub-part A_(i), and q is the non-adaptivequantization step size used to quantize the data points. As notedpreviously, q _(i), may be calculated by taking the mean (or median,etc.) of the data points within the sub-part A_(i). That is, the i-threconstruction level may be represented by the offset (or averagedeviation) of the data points, c^((i)) _(n), from the conventionalreconstruction point of q, which is expressed as:

$\begin{matrix}{\delta_{i} = {{\frac{1}{N_{i}}{\sum\limits_{n = 1}^{N_{i}}c_{n}^{(i)}}} - {i \cdot q}}} & (5)\end{matrix}$

In Equation (5), N_(i) is the number of data points in the sub-partA_(i), and c ^((i)) _(n) is the n^(th) data point within the sub-partA_(i).

It will be appreciated that in an alternative implementation, the offsetδ_(i) may be calculated as an offset to the quantization step size q,instead of an offset to the reconstruction level i·q. That is the offsetδ_(i) would result in a reconstruction level of i·(q+δ_(i)). Similarly,the offset δ_(i) may be calculated as an offset to the index i, whichresults in a reconstruction level of (i+δ_(i))·q. It will be appreciatedthat any of the embodiments described herein may be implemented usingthese variations for expressing the offset.

It may be noted that there is a difference between the offset ofreconstruction levels shown in Equation (5) and the adaptive roundingoffset, f, mentioned above in connection with Equation (1). The roundingoffset is applied on the encoder side to change the quantizationpartitions and it is not needed by the decoder. On the other hand, thereconstruction level offset here is computed on the encoder side and iscommunicated to the decoder to be used to enhance the reconstruction.

In one example embodiment, the transmitted adaptive reconstruction levelinformation, whether it is explicit reconstruction levels q_(u) oroffsets δ_(u), may be normalized. For example, the offsets may benormalized by dividing by q, thereby resulting in a real number within alimited range of (0, 1), which can be represented by a fixed pointinteger that is relatively easily encoded. Accordingly, in variouspossible embodiments, the encoder and decoder may be configured to useadaptive reconstruction levels in quantization by sending explicitreconstruction levels, normalized explicit reconstruction levels,offsets for determining the reconstruction levels, or normalized offsetsfor determining the reconstruction levels. In yet further embodiments,any of these possible implementations may use differential encoding fromthe previously sent level/offset for a given sub-part.

As mentioned above, the rate-distortion analysis may result in sendingadaptive reconstruction level data (whether levels or offsets) for onlysome of the sub-parts. In simulations and testing it has been found thatthe rate-distortion analysis often results in sending of adaptivereconstruction data for only the first two sub-parts, e.g. indices u=1and 2. These are also usually the sub-parts that contain the largestshare of the data points. In other words, the majority of data pointsthat are quantized fall into the first couple of indices. Thus, therate-distortion analysis, for example as described above, may, in oneembodiment, be simplified such that the decision to transmit adaptivereconstruction level data for a sub-part is based upon the number ofdata points quantized to that index. In other words, the encoder maycount the number of data points in a sub-part A_(i), i.e. quantized toindex i, and if the number of data points exceeds a threshold number, T,then the adaptive reconstruction level q_(i) or offset δ_(i) for thatindex u=i is transmitted in the bitstream. In some embodiments, thethreshold number may be index-dependent, i.e. T_(i).

Using the number of data points as a determinant for whether to send anadaptive reconstruction level or offset avoids the need to includesignaling in the bitstream as to which indices have adaptivereconstruction levels or offset, because the decoder can count thenumber of data points for each sub-part A_(i) by simply counting theindices u=i and thus identify, based on the thresholds, whether anadaptive reconstruction level or offset is in the bitstream. In someembodiments, the thresholds may be preset within the encoder anddecoder. In some embodiments, the thresholds may be configurable and maybe communicated to the decoder in initial header information of thebitstream.

In one embodiment, the count of data points may not be separatelycollected for each sub-part. It may be too computationally costly todifferentiate all sub-parts and collect counts for all sub-parts.Accordingly, in one embodiment, the total count for all parts iscollected and used to estimate the count for each sub-part based on someempirical formula (e.g., the first sub-part corresponds to 80% of thetotal count), and then a sub-part-specific threshold is applied.

As noted above, it has been found in simulations that therate-distortion decision on whether to send adaptive reconstructionlevels often results in only sending levels/offsets for the first two orthree indices. It has also been found that the offsets amongst theremaining sub-parts are somewhat consistent. Accordingly, in someembodiments the encoder may calculate an average of the remainingoffsets and may transmit the average offset d for use in adjusting thereconstruction levels of those sub-parts for which there is not anexplicit transmitted adaptive reconstruction level offset.

Reference is now made to FIG. 8, which shows a flow diagram for anexample method 500 of encoding data. The method 500 begins in operation502 with initializing reconstruction levels. In operation 504, encodingof a current frame begins. As will be appreciated, the encoding includesdetermining coding mode, motion vectors, residual data, etc., for codingunits within the frame. The residual data is transformed to realizetransform domain coefficients (TCOEFFs), which are then quantized toquantized TCOEFFs, i.e., indices u. The TCOEFFs are data points withinthe data space S_(i). The quantization operation converts the datapoints within respective sub-parts A_(i) to respective indices u=i. Inthis embodiment, hard-decision quantization with a fixed quantizer ispresumed; however, in other embodiments soft-decision quantization maybe employed in operation 504.

As noted in operation 506, the encoder determines, for each sub-partA_(i) (e.g. index u=i), the offset δ_(i) and the number of data points(TCOEFFs) within that sub-part A_(i). In operation 508, the encoderassesses for each sub-part A_(i) whether the number of data points N_(i)in that sub-part exceeds the threshold value T_(i) for that sub-part. Ifso, then in operation 506 the calculated offset δ_(i) for that subpartA_(i) is placed in the bitstream.

In operation 510, the encoder calculates an average offset value d basedon the calculated offset values for those sub-parts that did not haveenough data points to meet the criteria of N_(i)>T_(i). In someembodiments, the average offset d may be calculated over all thesub-parts. In some embodiments, the average offset d may be calculatedas a weighted average based on the number of data points per sub-part.In this embodiment, the average offset d is the weighted average forthose sub-parts that did not meet the criteria of N_(i)>T_(i). Anexample formula for the average offset d is:

$\overset{\_}{\delta} = {( {\sum\limits_{N_{i} \leq T_{i}}{\delta_{i} \cdot N_{i}}} )/( {\sum\limits_{N_{i} \leq T_{i}}N_{i}} )}$

It will be appreciated that operations 504, 506,508, and 510 are notnecessarily implemented linearly. For example, the counting of datapoints and determination as to whether they exceed a threshold can occurwithin the encoding process of operation 504. As another example, theaverage offset is not necessarily inserted in the bitstream after theexplicit offsets are inserted; in some cases, the average offset may beplaced ahead of any explicit offsets.

The bitstream is output as indicated in operation 512.

As indicated in operation 514, in this embodiment the reconstructionlevels used to make coding decision in the encoding process of operation504 are updated using the offset data calculated in operations 506 and508. In one embodiment, average offset data may be used for thosesub-parts that had too few data points; however, in other embodiments,the actual offsets for each sub-part are used in operation 514 to updatereconstruction levels. The updated reconstruction levels are then usedby the encoder in performing the encoding of the next group of codingunits, whether it is a frame, slice, GOP, etc.

It will be appreciated that the process shown in FIG. 8 can be performedwith respect to a group of coding units. A group of coding units can bea frame, slice, tile, rectangular slice group, GOP, or other grouping ofcoding units. In one embodiment, the group of coding units is all codingunits within a frame or GOP having the same qP parameter.

In the embodiment shown in FIG. 8, the current frame for which offsetsare calculated is not re-encoded using adaptive reconstruction levels.Rather it is transmitted together with the offset data forreconstruction at the decoder. The decoder uses the offsets to adjustthe reconstruction levels for the current frame.

In one exemplary embodiment, a set of adaptive reconstruction levels maybe assigned to a group of coding units, with each coding unit (CU)covering an M×M area. In some examples, M may be equal to 16, or 32, or64, or 128 as is proposed in developmental work on HEVC. Suppose thateach group of coding units contains J CUs, where J might be a parameterspecified in the side information. In one case, the exemplary decodingprocess with adaptive reconstruction levels may be described as follow:

-   -   1. Decode adaptive reconstruction level data (or offset data),        for example, from the slice header, to determine a set of        adaptive reconstruction levels;    -   2. Initialize a counter numCUs=0;    -   3. Decode indices for one CU and reconstruct the CU by        reconstructing the data points of the CU from the indices using        the adaptive quantization levels;    -   4. Increase the counter numCUs by one;    -   5. Repeat operations 2 through 4 until the counter numCUs==J;        and    -   6. Repeat operations 1 through 5 until the slice is completely        decoded.

In the above-described embodiment the adaptive reconstruction level dataor offset data may be explicit adaptive reconstruction levels oroffsets, or may be differentially encoded. That is, the adaptivereconstruction level may be obtained by first using previouslydetermined adaptive reconstruction levels to derive a prediction, andthen add the prediction to a decoded prediction residual.

In the embodiment described above, each adaptive reconstruction level oroffset, or, equivalently, its prediction residual, may be described byusing N_(b) bits.

In yet another exemplary embodiment, the decoding process for a group ofJ CUs can be described as follows:

-   -   1. Initialize the counter numCUs=0;    -   2. Decode indices for one CU and store all decoded syntax        elements;    -   3. Increase the counter numCUs by one;    -   4. Repeat operations 2 and 3 until numCUs==J;    -   5. Decode adaptive reconstruction level data to determine the        set of adaptive reconstruction levels, and reconstruct the J CUs        by using these adaptive reconstruction levels; and    -   6. Repeat operations 1 through 5 until the slice is completely        decoded.

While the two embodiments described above use the number of CUs tocontrol the decoding process, i.e. to indicate when the bitstream willcontain new adaptive reconstruction level data, another embodiment mayuse a different parameter. For example, in another embodiment theparameter for the decoding procedure is the total number of non-zerocoefficients, as exemplified in the following sample process:

-   -   1. Initialize counter NNZtotal=0;    -   2. Decode indices for one CU, add the number of nonzero        coefficients in the current CU to NNZtotal, and store all        decoded syntax elements;    -   3. Repeat operation 2 until NNZtotal reaches a given threshold;    -   4. Decode adaptive reconstruction level data to determine a set        of adaptive reconstruction levels, and reconstruct all stored        CUs by using these adaptive reconstruction levels; and    -   5. Repeat operations 1 through 4 until a whole frame is decoded        and reconstructed.

In one implementation of the example process above, the decoding ofadaptive reconstruction level data may further be controlled by a set ofcounters named NNZcounter(i), which count the number of nonzerocoefficients falling into the i^(th) subpart. Accordingly, operation 4of the process above may be implemented as:

-   -   4a. Set i=1.    -   4b. If NNZcounter(i)>ThresholdNNZ, decode an offset δ_(i) for        the i-th adaptive reconstruction level.    -   4c. Repeat operation 4a. when i is smaller than a threshold Tc.    -   4d. If NNZcounter(Tc)>ThresholdNNZ, decode an average offset δ,        which will be used for all remaining reconstruction levels.

The ThresholdNNZ in the above exemplary process may be determined byempirical observations. One suitable choice for use in some example HEVCcoding is 100. The threshold Tc may also determined based on datastatistics. One suitable choice for use in some example HEVC coding is3.

The above exemplary process for decoding offset data (or adaptivereconstruction level data) involves counting the number of nonzerocoefficients for many different reconstruction levels, which introducesextra computational complexity to both the encoder and the decoder. Insome cases, the complexity increase might be undesired. In these cases,one total counter, named NNZtotal may be used. An example process usingthis variation is outlined below:

-   -   4a. Set i=1.    -   4b. If NNZtotal>Threshold(i), decode an offset δ_(i) for the        i-th reconstruction level    -   4c. Repeat operation 4b. when i is smaller than a threshold Tt.    -   4d. If NNZtotal>Threshold(Tt), decode an average offset for all        remaining reconstruction levels.

The variable Threshold(i) in the above exemplary embodiment may bedetermined based on the empirical observation of the ratio among thenumber of different reconstruction levels. One possible choice of theratio in video codecs, such as HEVC, may be 14:2:1, in a case where thethreshold is set to Tt=3. Correspondingly, one choice of thosethresholds might be Thr*17/14, Thr*17/2, and Thr*17, where Thr is aconstant, for which 60 may be a suitable choice in some cases, meaningthat it is likely worth transmitting adaptive reconstruction level data(e.g. offset data) for every 60 nonzero coefficients.

The N_(b)-bit representation of a reconstruction offset in the aboveexemplary embodiment may vary for different applications. For HEVC,observations show that 5-bit precision is sufficient for achievingacceptable rate distortion performance. In one example implementation,this 5-bit representation is achieved using a two-step process. First,the whole range of (0, q) is represented with a 9-bits precisionuniformly. Second, the 9-bits numbers are quantized to 5-bit, followinga rule of ensuring a uniform distribution of δ². Note that the ratevalue of each reconstruction offset is proportional to δ².

A finite precision, e.g. an N_(b)-bit, representation of areconstruction offset may be further entropy coded by either usingvariable-length coding or arithmetic coding to reduce the average rate.

In another example embodiment, transmission and usage of adaptivereconstruction levels may mainly be controlled by the total number ofnonzero coefficients. Specifically, the decoder monitors the NNZcounterand compares it with some threshold after receiving each coding unit. Inthis example, the number of total coding units is not used. Yet, it willbe noted that the NNZcounter will be checked against the threshold atthe coding unit boundary.

In yet another example embodiment, the control mechanism for usage ofadaptive reconstruction levels might be signaled to the decoder. Forexample, a flag might be inserted to the slice header or a frame header,to indicate which of the following mechanisms is used to control thetransmission and usage of adaptive reconstruction levels: 1) the totalnumber of nonzero coefficients; 2) the number of CUs; or 3) acombination of these two methods.

In another embodiment, this single pass procedure is used, but theadjustment of conventional reconstruction levels in operation 514 isomitted. That is, the offsets are not used to adjust reconstructionlevels for encoding of the next frame (or other group of coding units).

In yet another embodiment, a two-pass procedure may be used in which thecurrent frame (or other group of coding units) is re-encoded inoperation 504 using the adaptive reconstruction levels determined inoperation 506. The changes in reconstruction level may result indifferent rate-distortion decisions, which can change the coding modeand motion vector decisions made during encoding. The offsets are thentransmitted with the re-encoded video so that the decoder canreconstruct the video using the same reconstruction levels used in theencoding decisions. It will be appreciated, that the two-pass procedureadds some delay and complexity to the encoding process.

In yet a further embodiment, the frame (or other grouping of codingunits) may be iteratively re-encoded until a change in rate-distortionor offset values is less than a threshold amount. A process of thisnature was illustrated and described above in connection with FIG. 6.

Reference is now may to FIG. 9, which diagrammatically shows an exampleformat of a portion of a bitstream 600. The bitstream contains encodeddata 602, which contains, among other things, the entropy encodedindices for a group of coding units, such as a frame, slice, GOP, etc.The bitstream also includes encoded offset data 604. The encoded offsetdata 604, in this embodiment, includes average offset data 606. Theencoded offset data 604 may also include zero or more explicit offsets608 (shown as 608 a and 608 b), depending on whether the number of datapoints or a rate-distortion analysis justified the sending of anexplicit offset for at least one of the sub-parts. In this example, twoexplicit offsets 608 a and 608 b are shown in the bitstream 600. Furtherencoded data 610 may follow the offset data 604.

The bitstream 600 may be transmitted in digital form using any of anumber of protocols. For example, in some cases the bitstream 600 may bestreamed or downloaded over a packet-based connection, such as an IPconnection, whether wired, wireless, or both. Various communicationsprotocols may be used to facilitate transmission. In some cases, thebitstream 600 may be stored on a processor-readable memory, such as aflash memory, DVD, Blu-Ray™ disc, or any other storage medium, whetheroptical, magnetic, or other.

An example method 700 for decoding compressed data is shown in FIG. 10in flow diagram format.

The method 700 begins with receipt of the bitstream by the decoder inoperation 702. The bitstream may be received by reading data from aprocessor-readable memory or receiving the data from a remote sourceover a data connection. Operation 702 also indicates initialization ofthe thresholds T_(i). The initialized thresholds may be specified in thebitstream or may be default values. In some cases, if the thresholds aredefault values then they may be overridden or modified by threshold dataspecified in the bitstream.

In operation 704, the decoder entropy decodes a portion of the bitstreamto obtain indices u, i.e. the quantized TCOEFFs, for a group of codingunits (a frame, or slice, etc.). The decoder counts the number of eachof the indices obtained in operation 704, i.e. the number of data pointsN_(i) in each sub-part. The decoder may then determine in operation 706whether the number of data points N_(i) for each index/sub-part exceedsits respective threshold T_(i).

In operation 708, the decoder extracts the average offset value d fromthe bitstream and, based upon the determination made in operation 706,any explicit offset values that are expected to be in the bitstreambecause N_(i)>T_(i) for that index i.

The decoder then, in operation 710, reconstructs the data points, i.e.dequantizes the indices u, using adaptive reconstruction levels, wherethe adaptive reconstruction levels are based upon the predefinedreconstruction levels adjusted using offset data obtained in operation708. For any indices for which an explicit offset was extracted, theadaptive reconstruction level is determined using that explicit offset.For any other indices, the adaptive reconstruction level is determinedusing the average offset value d.

The decoder may repeat operations 704 to 710 provided the bitstream hasadditional encoded data for a next group of coding units, as indicatedby operation 712.

It will be appreciated that the dequantized data resulting fromoperation 710 is then processed by the decoder in the remainder of thedecoding process. For example, the dequantized data is inversetransformed to produce reconstructed residual data, which may then besubjected to motion or spatial compensation processes to generatereconstructed video data.

Observations have shown that the adaptive reconstruction levelstatistics are related to the quantization parameter (qP) and to thedata type. In general, four data types may be identified: InterY,InterUV, IntraY, and IntraUV. The InterY data type refers to Lumaresidue values from an Inter prediction process. InterUV data typerefers to Chroma residue values from an Inter prediction process.Similarly, IntraY data type refers to Luma residue data from an Intraprediction process, and IntraUV data type refers to Chroma residuevalues from an Intra prediction process.

In view of these observations, offset data for adaptively adjustingreconstruction levels may be specific to a data type and to a portion ofthe data using a give qP value. For example, in HEVC development it isexpected that each frame or slice may have a specific qP value. In someembodiments, a qP value may be specified for a group-of-pictures (GOP).In yet other embodiments, the qP value may be specified for anothergrouping of blocks of data. Each portion of data, e.g. frame or slice,may have offset values for one or more data types for eachreconstruction level being adjusted.

It has also been observed that, although there are a large number ofreconstruction levels covering a wide range (in HEVC the levels arespecified using 12 bits), the vast majority of data points falls withinthe first few levels. Accordingly, it is these first few levels thatoccur most frequently and that are worth adaptively adjusting to reflectempirical statistics of the data. In some embodiments, a parameter maybe specified, such as ARL_range, to signal to the decoder how many ofthe reconstruction levels are to be adapted; i.e., how many levels haveassociated offset data in the bitstream. In another embodiment, thenumber of level may be preconfigured or preset for a particularencoder/decoder; for example, through signaling the ARL_range parameterin a header to the video data, or elsewhere in the bitstream.

Referring now to FIG. 13, an example process 800 for decoding encodeddata using adaptive reconstruction levels will be described. The process800 may be implemented by a decoder. The decoder may, in someimplementations, include a decoding application executing on a computingdevice, such as a video playback machine, a personal computer, atelevision, a mobile device, a tablet, or any other digital processingdevice.

The process 800 begins in operation 802 with determining that adaptivereconstruction levels are to be used. As noted above, in some instancesadaptive reconstruction levels may be specific to a frame or slice, ifeach frame or slice has its own qP specified. Accordingly, operation 802may include checking a flag or other indicator in the frame or sliceheader to determine whether adaptive reconstruction levels are enabledfor this particular frame or slice.

In operation 804, the decoder determines which data types haveassociated adaptive reconstruction level data. Not every data type willnecessarily have offset data in the bitstream. For example, in someinstances the encoder may use adaptive reconstruction levels for theInter Luma residuals for the first four reconstruction levels, but mayonly use adaptive reconstruction levels for the Inter Chroma residualsfor the first two reconstruction levels. Operation 804 may includeextracting flags, indicators, or other data from the bitstream thatindicates to the decoder for which data types there is offset data inthe bitstream for certain levels. Operation 804 may also includedetermining how many levels have offset data and, if there is offsetdata for a level, for which data types. In some cases, the levels anddata types may be preset or preconfigured; however, in other cases, thelevels and/or the data types involved may be signaled in the bitstream.

In operation 806, the decoder extracts offset data from the bitstream.Based on operation 804, it knows whether there is offset data forparticular levels and/or data types. Accordingly, it extracts this datain operation 806. In some embodiments, the offset data is absoluteoffset data. In some cases, it is differential offset data, meaning itis an offset relative to a most recent offset for the same index/datatype. In some implementations, the offset data in the bitstream may bean index to an ordered array of offset values, i.e. a pointer to one ofthe offset values in the array. In one example, the offset values mayrange from −N to +N, wherein N is a maximum offset value.

Having extracted the offset data, and in some case having determined theoffset value from the offset data, the decoder then, in operation 808,calculates the adaptive reconstruction levels for each level and datatype involved. In particular, the decoder adjusts a predeterminedreconstruction level for that level (index) and data type using theoffset data for that level and data type extracted in operation 806. Thepredetermined reconstruction level may be the unadjusted reconstructionlevel in some implementations. The predetermined reconstruction levelmay be the most-recently used (i.e. previously adjusted) adaptivereconstruction level.

The predetermined reconstruction level may be adjusted by adding theextracted offset value to a previously used and stored offset value (inthe case of differential offsets). The updated offset value may then beused to adjust the original unadjusted reconstruction level to arrive atthe adaptive reconstruction level.

Once the adaptive reconstruction levels have been determined for thevarious levels and data types, then in operation 810 the decoder entropydecodes the encoded data in the bitstream to obtain indices (quantizedtransform domain coefficients).

In operation 812, the decoder reconstructs data points by dequantizingthe quantized transform domain coefficients. In the case of thosecoefficients (indices) that have an associated adaptive reconstructionlevel, the adaptive reconstruction level is used to reconstruct the datapoint. For example, the data point for an adaptive reconstruction levelmay be reconstructed by multiplying the adaptive reconstruction level bythe quantization step size specified by the q. In some instances, themultiplication may further include scaling, such as is seen in H.264/AVCor HEVC. In some instances this scaling may be part of the inversetransform process, such that the resulting data point is a scaledinverse-transformed dequantized residual value.

This example process 800 is further illustrated by the following syntaxexample.

The slice header syntax may specify a syntax function: arl_param( ) forimplementing adaptive reconstruction levels. An example of this syntaxfunction may be given by:

arl_param( ) { Descriptor  arl_slice_flag u(1)  If(arl_slice_flag)  {  arl_interY_flag u(1)   if (arl_interY_flag)   {   read_arl_data(ARL_TYPE_INTERY)    arl_interUV_flag u(1)    if(arl_interUV_flag)    {     read_arl_data(ARL_TYPE_INTERUV)    } u(1)  }   arl_intraY_flag u(1)   if(arl_intraY_flag)   {    read_arl_data(ARL_TYPE_INTRAY);     arl_intraUV_flag u(1)      if(arl_intraUV_flag)     {      read_arl_data (ARL_TYPE_INTRAUV)      }    }  } }read_arl_data (arl_data_type_id){   arl_delta_idx[slice_qp][arl_data_type_id][1] vlc(v)   for(i=2; i<=4;i++){   arl_delta_i_available u(1)    if (arl_delta_i_available = = 1) {     arl_delta_idx[slice_qp][ arl_data_type_id][i] vlc(v)    }    else     break    } }

It will be noted that in this example, it is predetermined that adaptivereconstruction levels are specified for the first level and, possibly,for the second through fourth levels, as indicated by thearl_delta_i_available flag in each case. Note that the value of 4 is anexemplary choice for the parameter of level range, which may take othervalues. The association between arl_data_type_id and the data type namesmay, in one example, be:

arl_data_type_id Data type 0 ARL_TYPE_INTRAY 1 ARL_TYPE_INRAUV 2ARL_TYPE_INTERY 3 ARL_TYPE_INTERUV

It will be appreciated that other mechanisms for signaling ARLparameters may be used. Indeed, in some cases, the ARL data may beprovided as slice training bits and the statistics of the current slicemay be used to determine which levels or data types have ARL datapresent. For example, a number of non-zero coefficients algorithm may beused, such as is described above.

The syntax element arl_delta_idx[qP][DataType][i] specifies the offsetfor index i for data type DataType with quantization parameter qP. Theparameter arl_delta_idx[e][DataType][i] may be a pointer to an offsetvalue in an array. The parameter may be converted to the offset value asfollows:ARLoffsetd[qP][DataType][i]=Idx2Delta[arl_delta_(—) idx[ ][DataType][i]]

where the array, Idx2Delta is defined, in one example, as:int Idx2Delta[16]={−15, −13, −11, −9, −7, −5, −3, 0, 1, 3, 5, 7, 9, 11,13, 15};

The ARLoffsetd, which is a differential offset, is then used to updateARLoffset, the most-recently-used offset value for the same index, qPand DataType to produce an updated offset value:ARLoffset[qP][DataType][i]+=ARLoffsetd[qP][DataType][i], 1<=i<=4;ARLoffset[qP][DataType][i]+=ARLoffsetd[qP][DataType][4], i>4;

It will be appreciated from the foregoing formulas that, in this exampleimplementation, ARLoffsets are individually calculated for each of thefirst four levels, and the level 4 offset is applied to all levels abovefour. The updated ARLoffset is then applied to find the reconstructionlevel for each index:ARL[qP][DataType][i]=ARLoffset[qP][DataType][i]+(i<<7), i>0;

It will be noted that the index value is left shifted by 7 bits, i.e.multiplied by 128. The value of 7 is an exemplary choice for setting thecomputation precision and other values may be used. The ARL is laterdescaled by 128, with the net effect being that the offset value isdivided by 128. With a range of −15 to +15, this ensures that thedifferential change in the offset varies from slice-to-slice by no morethan ±15/128 or about 12%.

The ARL value is then used in the dequantization operation. For example,the dequantization operation in one example may be expressed as:d _(ij) =sgn(c _(ij))*(ARL[qP][DataType][abs(c_(ij))]*LevelScale_((nS)×(nS))[qP%6][i][j])<<(qP/6+trafoPrecisionExt−7),with i,j=0 . . . nS−1  (6)

The resulting data point d_(ij) is calculated based upon the decodedquantized transform domain coefficient c_(ij) (sometimes also referredto as an “index”) multiplied by the updated ARL value and a scalingfactor that reflects a non-integer portion of the inverse transformationoperation. The dequantization operation reflected in the above Equation(6) further includes a bitshift operation that incorporates both thedescaling by 128 (the −7 component), and the dequantization.

It will be understood that the foregoing pseudo-code, expressions andequations provided one example implementation of the present decodingprocess. The present application is not limited to this particularexample implementation.

Through experimental simulations, it has been found that usingoffset-based adaptive reconstruction levels with hard-decisionquantization, under the low-complexity low-delay setting of HEVC codec,outperforms the anchor codec with SDQ by 1% in terms of rate-distortionperformance and realizes a computational complexity savings of 10% dueto removal of the SDQ procedure. It may be noted that encodingcomplexity has become a bottleneck in the development of HEVC. Theprocesses and methods described herein provide a desirable quantizationdesign with a good trade-off between rate distortion coding performanceand computational complexity.

Reference is now made to FIG. 11, which shows a simplified block diagramof an example embodiment of an encoder 900. The encoder 900 includes aprocessor 902, memory 904, and an encoding application 906. The encodingapplication 906 may include a computer program or application stored inmemory 904 and containing instructions for configuring the processor 902to perform steps or operations such as those described herein. Forexample, the encoding application 906 may encode and output bitstreamsencoded in accordance with the adaptive reconstruction level processdescribed herein. The input data points may relate to audio, images,video, or other data that may be subject of a lossy data compressionscheme. The encoding application 906 may include a quantization module908 configured to determine an adaptive reconstruction level for eachindex of a partition structure. The encoding application 906 may includean entropy encoder 26 configured to entropy encode the adaptivereconstruction levels q_(u) or offset data, and other data. It will beunderstood that the encoding application 906 may be stored in on acomputer readable medium, such as a compact disc, flash memory device,random access memory, hard drive, etc.

Reference is now also made to FIG. 12, which shows a simplified blockdiagram of an example embodiment of a decoder 1000. The decoder 1000includes a processor 1002, a memory 1004, and a decoding application1006. The decoding application 1006 may include a computer program orapplication stored in memory 1004 and containing instructions forconfiguring the processor 1002 to perform steps or operations such asthose described herein. The decoding application 1006 may include anentropy decoder 1008 and a de-quantization module 1010 configured toobtain offset data or adaptive reconstruction levels q_(u) and use thatobtained data to reconstruct transform domain coefficients or other suchdata points. It will be understood that the decoding application 1006may be stored in on a computer readable medium, such as a compact disc,flash memory device, random access memory, hard drive, etc.

It will be appreciated that the decoder and/or encoder according to thepresent application may be implemented in a number of computing devices,including, without limitation, servers, suitably programmed generalpurpose computers, audio/video encoding and playback devices, set-toptelevision boxes, television broadcast equipment, and mobile devices.The decoder or encoder may be implemented by way of software containinginstructions for configuring a processor to carry out the functionsdescribed herein. The software instructions may be stored on anysuitable computer-readable memory, including CDs, RAM, ROM, Flashmemory, etc.

It will be understood that the encoder described herein and the module,routine, process, thread, or other software component implementing thedescribed method/process for configuring the encoder may be realizedusing standard computer programming techniques and languages. Thepresent application is not limited to particular processors, computerlanguages, computer programming conventions, data structures, other suchimplementation details. Those skilled in the art will recognize that thedescribed processes may be implemented as a part of computer-executablecode stored in volatile or non-volatile memory, as part of anapplication-specific integrated chip (ASIC), etc.

Certain adaptations and modifications of the described embodiments canbe made. Therefore, the above discussed embodiments are considered to beillustrative and not restrictive.

What is claimed is:
 1. A method of decoding a bitstream of compresseddata, the method comprising: decoding the compressed data to obtain aplurality of quantized transform coefficients; extracting offset datafrom the bitstream, wherein the offset data is associated with aquantization index; extracting average offset data from the bitstream,wherein the average offset data is associated with two or morequantization indices; calculating a reconstruction level for thequantization index by adjusting a predetermined reconstruction levelusing the offset data; calculating a respective reconstruction level foreach of the two or more quantization indices by adjusting respectivepredefined reconstruction levels using the average offset data; anddequantizing each quantized transform coefficient that corresponds to arespective quantization index to generate a data point using thatquantization index's respective calculated reconstruction level.
 2. Themethod claimed in claim 1, wherein the predetermined reconstructionlevel comprises a previously-adjusted reconstruction level for thequantization index, and the respective predetermined reconstructionlevels comprise and respective previously-adjusted reconstruction levelsfor the respective two or more quantization indices.
 3. The methodclaimed in claim 1, wherein the offset data comprises a pointer to anoffset value in an array of offset values, and wherein calculatingcomprises adding the offset value to the quantization index to generatethe calculated reconstruction level.
 4. The method claimed in claim 1,wherein the offset data comprises a pointer to an offset value in anarray of offset values, and wherein calculating comprises adding theoffset value to a previously-used offset for the quantization index togenerate an updated offset, and adding the updated offset to anunadjusted reconstruction level for the quantization index.
 5. Themethod claimed in claim 1, wherein dequantizing comprises multiplyingthe calculated reconstruction level by a scaled quantization factor togenerate the data point.
 6. The method claimed in claim 1, whereindequantizing further includes reconstructing residues, which includesinverse transforming, and wherein the data point comprises areconstructed scaled inverse-transformed dequantized residual.
 7. Themethod claimed in claim 1, wherein the plurality of quantized transformcoefficients corresponds to a coding unit.
 8. A decoder for decoding abitstream of compressed data, the decoder comprising: a processor; amemory; and a decoding application stored in memory and containinginstructions for configuring the processor to decode the compressed datausing the method claimed in claim
 1. 9. The decoder claimed in claim 8,wherein the predetermined reconstruction level comprises apreviously-adjusted reconstruction level for the quantization index, andthe respective predetermined reconstruction levels comprise andrespective previously-adjusted reconstruction levels for the respectivetwo or more quantization indices.
 10. The decoder claimed in claim 8,wherein the offset data comprises a pointer to an offset value in anarray of offset values, and wherein the processor is configured tocalculate by adding the offset value to the quantization index togenerate the calculated reconstruction level.
 11. The decoder claimed inclaim 8, wherein the offset data comprises a pointer to an offset valuein an array of offset values, and wherein the processor is configured tocalculate by adding the offset value to a previously-used offset for thequantization index to generate an updated offset, and adding the updatedoffset to an unadjusted reconstruction level for the quantization index.12. The decoder claimed in claim 8, wherein the processor is configuredto dequantize by multiplying the calculated reconstruction level by ascaled quantization factor to generate the data point.
 13. The decoderclaimed in claim 8, wherein the processor is further configured toreconstruct residues, which includes inverse transforming, and whereinthe data point comprises a reconstructed scaled inverse-transformeddequantized residual.
 14. The decoder claimed in claim 8, wherein theplurality of quantized transform coefficients corresponds to a codingunit.
 15. A non-transitory processor-readable medium storingprocessor-executable instructions which, when executed, configures oneor more processors to perform the method claimed in claim
 1. 16. Amethod for encoding transform domain coefficients for a group of codingunits, wherein the transform domain coefficients are quantized by aquantizer that associates each transform domain coefficient with aquantization index based upon in which sub-part of a partitioned dataspace that transform domain coefficient is located, the methodcomprising: for each of a plurality of the sub-parts, determining arespective average transform domain coefficient for that sub-part;calculating an offset for each sub-part of the plurality of sub-parts bydetermining a difference between the respective average transform domaincoefficient for that sub-part and a predetermined reconstruction levelfor that sub-part; calculating an average offset for at least two of thesub-parts; and entropy encoding the quantization indices associated withthe transform domain coefficients to output a bitstream of compresseddata and inserting into the bitstream offset data from which one of theoffsets for one of the sub-parts can be calculated and average offsetdata from which the average offset for the at least two of the sub-partscan be calculated.
 17. The method claimed in claim 16, wherein thedetermining, calculated and entropy encoding are applied on aslice-by-slice basis.
 18. The method claimed in claim 17, wherein thedetermining, calculating and entropy encoding are further applied on adata-type basis, and wherein inserting includes inserting flagsindicating the data types for which offset data is inserted in thebitstream.
 19. The method claimed in claim 18, wherein the data typesinclude Inter Luma data, Inter Chroma data, Intra Luma data, and IntraChroma data.
 20. The method claimed in claim 16, wherein the offset datacomprises differential offset data specifying the difference between thecalculated offset for said one of the sub-parts and a previously-usedoffset for said one of the sub-parts.
 21. The method claimed in claim16, wherein the offset data comprises a pointer to a value in apredetermined array of offset values.
 22. An encoder for encodingtransform domain coefficients for a group of coding units, the encodercomprising: a processor; a memory storing the data points; and anencoding application stored in memory and containing instructions forconfiguring the processor to encode the transform domain coefficientsusing the method claimed in claim
 16. 23. A non-transitoryprocessor-readable medium storing processor-executable instructionswhich, when executed, configures one or more processors to perform themethod claimed in claim
 16. 24. The method claimed in claim 1, whereinthe extracting average offset data from the bitstream is performed inresponse to decoding a stop code indicating that no further individualquantization index offset data is coded in the bitstream.
 25. The methodclaimed in claim 1, further comprising determining a count of quantizedtransform coefficients, and wherein the extracting average offset datais performed for the two or more quantization indices in response tocomparing the count of quantized transform coefficients with a thresholdvalue.
 26. The method claimed in claim 25, wherein determining a countincludes determining the number of quantized transform coefficientscorresponding to one of the two or more quantization indices, andwherein comparing includes determining that the number is less than athreshold value.
 27. The method claimed in claim 26, wherein thethreshold value is specific to said one of the two or more quantizationindices.